/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package GUInemeanshop;

import components.NPanel;
import components.NTable;
import components.NTablemod;
import java.awt.BorderLayout;
import java.awt.Dimension;
import java.util.ArrayList;
import javax.swing.DefaultListModel;
import javax.swing.JLabel;
import javax.swing.JList;
import javax.swing.JScrollPane;
import nemeanshop.Cashier;
import nemeanshop.NemeanShop;

/**
 *
 * @author havardaxelsen
 */
public class GUICashier extends NPanel{

    private JScrollPane         scroll;
    private ArrayList<Cashier>  plist;
    private NTablemod           mod;
    private DefaultListModel    mod2;
    private NTable              tab;
    private Dimension           dim = new Dimension(400,400);
    private NemeanShop          ns;
    private JList               liste;
    private JLabel              tot;
    
    public GUICashier(NemeanShop ns)
    {   
        setLayout(new BorderLayout());
        this.ns = ns;
        tot     = new JLabel("0");
        plist   = ns.getCashiers();
        liste   = new JList(plist.toArray());
        liste.setFocusable(false);
        mod2    = new DefaultListModel();
        scroll  = new JScrollPane(liste);
        
        setPreferredSize(dim);
        this.setMinimumSize(dim);
        this.add(scroll, BorderLayout.CENTER);
        this.add(tot, BorderLayout.SOUTH);
    }
}